package com.cruisecontrol4eclipse.core.model;

import com.cruisecontrol4eclipse.core.model.CruiseControlProject.Status;

public class CruiseControlProjectColor {
	public enum ProjectColor{
		GREEN,
		YELLOW,
		RED
	};
	public static ProjectColor getColor(CruiseControlProject project) {
		if(Status.NOW_BUILDING.equals(project.getStatus())) {
			return ProjectColor.YELLOW;
		} else  if(project.getLabel() != null && project.getLabel().equals(project.getLastSuccessfulBuildLabel())) {
			return ProjectColor.GREEN;
		} 
		return ProjectColor.RED;
	}
}
